//
//  XSDataListTableViewCell.m
//  小说
//
//  Created by WZH on 2018/5/28.
//  Copyright © 2018年 WZH. All rights reserved.
//

#import "XSDataListTableViewCell.h"


@implementation XSDataListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self initUI];
        [self configUI];
    }
    return self;
}

#pragma mark 初始化UI控件
- (void)initUI{
    self.numberLabel = [UILabel new];
    [self.contentView addSubview:self.numberLabel];
    self.nameLabel = [UILabel new];
    [self.contentView addSubview:self.nameLabel];
    self.urlLabel = [UILabel new];
    self.urlLabel.adjustsFontSizeToFitWidth = YES;
    [self.contentView addSubview:self.urlLabel];
}

#pragma mark 为UI控件添加约束
- (void)configUI{
    [self.numberLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_offset(20);
        make.top.mas_offset(10);
    }];
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_offset(0);
        make.left.equalTo(self.numberLabel);
    }];
    [self.urlLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.bottom.mas_offset(-10);
        make.right.mas_offset(-20);
    }];
}


@end
